Skip to content

feat: gate deploy on registration + on-chain code; bump indexer to 6.31.5#15

Merged
daithihearn merged 1 commit into
mainfrom
chore/deploy-gating-and-indexer-6.31.5
May 20, 2026
Merged

feat: gate deploy on registration + on-chain code; bump indexer to 6.31.5#15
daithihearn merged 1 commit into
mainfrom
chore/deploy-gating-and-indexer-6.31.5

Conversation

@daithihearn
Copy link
Copy Markdown
Member

Summary

  • vechain-dev up now skips the project's deploy command when the project is already registered in ~/.vechain-dev/config/<project>.json and every registered address still has code on thor-solo. Pass --redeploy to force.
  • New lib/check.mjs exports isProjectDeployed(project); re-exported from lib/register.mjs for consumers who want to gate their own deploy scripts.
  • Argv parsing in bin/vechain-dev.mjs extended to accept flags after the subcommand; --redeploy is honored on up.
  • Help text and TypeScript declarations updated.
  • Bump vechain-indexer and api images to 6.31.5.
  • Bump package version to 0.1.11.

Why

Without gating, every yarn dev in consumer repos (e.g. b3tr) re-deploys ~30 contracts on the shared thor-solo, taking ~5 min and rotating addresses. Gating on registration alone isn't enough: if thor-solo state is wiped but ~/.vechain-dev/config/ remains, the registration is stale. The hasCode liveness check on every unique registered address handles that case and falls through to a fresh deploy.

Test plan

  • vechain-dev up on a clean machine deploys (reason: not-registered).
  • Re-running vechain-dev up on the same project skips deploy.
  • vechain-dev up --redeploy forces deploy even when registered.
  • After vechain-dev reset, vechain-dev up deploys again (registration gone).
  • If thor-solo volume is wiped but ~/.vechain-dev/config/ remains, vechain-dev up detects missing code and redeploys.
  • Indexer and API containers come up on 6.31.5.

🤖 Generated with Claude Code

…31.5

vechain-dev up now skips the project's deploy command when the project is
already registered in ~/.vechain-dev/config/<project>.json AND every
registered address still has code on thor-solo. Pass --redeploy to force.
Also bumps vechain-indexer and api images to 6.31.5.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 20, 2026 13:42
@daithihearn daithihearn merged commit 68b2e6e into main May 20, 2026
5 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces unnecessary contract redeployments in local dev by gating the project deploy step on (1) the presence of a project registration file in ~/.vechain-dev/config/ and (2) an on-chain liveness check (hasCode) for all registered contract addresses, with a --redeploy override. It also bumps the indexer/api images and package version.

Changes:

  • Add isProjectDeployed(project) to determine whether a project’s registered addresses still have on-chain code, and expose it via the package entrypoint.
  • Update vechain-dev up to skip the deploy command when already deployed, and add --redeploy to force deploy; extend argv parsing to accept flags after the subcommand.
  • Bump vechain-indexer and api images to 6.31.5 and package version to 0.1.11.

Reviewed changes

Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
package.json Bumps package version to 0.1.11.
lib/register.mjs Re-exports isProjectDeployed for consumers.
lib/register.d.ts Adds TypeScript declarations for isProjectDeployed and its return type.
lib/check.mjs Implements registration + on-chain code gating via hasCode.
compose/indexer.yaml Updates indexer and api image tags to 6.31.5.
bin/vechain-dev.mjs Skips deploy when already deployed; adds --redeploy; adjusts flag parsing and help text.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/check.mjs
Comment on lines +13 to +16
export async function isProjectDeployed(project, { rpcUrl = DEFAULT_RPC } = {}) {
let registration
try {
registration = JSON.parse(await readFile(projectConfigFile(project), 'utf8'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants